home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
32
/
cadence.zip
/
VOL2NO2.ZIP
/
COGO218.LSP
next >
Wrap
Lisp/Scheme
|
1986-12-06
|
4KB
|
96 lines
; COGO218.lsp rev: 6 Dec 86
; =======================================================
; Written by Mark Carvalho
; Copyright (c) 1986 CADMAN, Inc.
; (303) 452-8440 PO Box 147, Denver, CO 80201
; =======================================================
;
; This set of functions (for Autocad 2.18) will perform the basic coordinate
; geometry functions: line (based on direction and distance of travel) and
; arc (based on direction and included angle of travel). Each function will
; automatically generate the line or arc, given user prompted input, and will
; then draw the junction circle at the starting point. This is accomplished in
; supplementary command format, not menu format. Two command functions are
; given for the arc conditions, one allowing for angle input in decimal degrees,
; the other for the standard degrees/minutes/seconds format.
;
; A pline is used for the arc commands because AutoCAD will give only radius,
; start, and endpoint data for regular arcs, whereas the radius, area enclosed,
; start point, start angle, end point, end angle, and length along the arc are
; all given for a pline arc. The opposite is true for pline versus line.
; AutoCAD reports only the start and end points for a pline, whereas for a line
; it gives the start point, end point, length, and angle for a regular line.
; Therefore the LGO command uses a line for its operation.
;
; Hint: Most parcel survey data is given in Degrees/Minutes/Seconds
; format and DECIMAL FEET, and AutoCAD 2.18 accepts only decimal
; inches. Therefore the most efficient way to input the data with
; these commands is to input all data as prompted, giving DECIMAL FEET
; as the response to the distance prompts. When the parcel is
; completed, make the entire parcel a block and reinsert it as a
; *block, giving it a scale factor of 12; then the parcel will be in
; feet and inches format.
;
;Functions: AGO - Arc coordinate GeOmetry
; LGO - bearing Line coordinate GeOmetry
; DAGO - Decimal Arc coordinate GeOmetry
; CRAD - Circle RADius
; -------------------------------------------------------
;
(setvar "CMDECHO" 0)
(defun C:AGO ()
(if (= crad nil) (setq crad (getdist "\nRadius for junction CIRCLE: ")))
(setq p1 (osnap
(getpoint "\nSelect line END to start ARC FROM (do not osnap): ") "endp"))
(command "line" p1)
(setq p2 (getpoint "\nSide to offset towards: "))
(command ())
(setq a1 (+ pi (angle p2 (osnap p1 "perp"))))
(setq ang (getangle "\nArc's included ANGLE: "))
(setq ans (getint "\nDirection? CCW=1 CW=2 <1>: "))
(if (= ans 2) (setq ang (* -1.0 ang)))
(setq rad (getdist "\nArc's RADIUS: "))
(setq p2 (polar p1 a1 rad))
(command "pline" p1 "A" "CE" p2 "A" (angtos ang 1 4) "")
(command "circle" p1 crad)
)
(defun C:LGO ()
(if (= crad nil) (setq crad (getdist "\nRadius for junction CIRCLE: ")))
(setq p1 (getpoint "\nPlace to START bearing LINE: "))
(setq dist (getdist p1 "\nLENGTH of bearing line: "))
(setq quad (getint "\nAngle QUADRANT NE=1 NW=2 SW=3 SE=4 <1>: "))
(setq ang (getangle "\nBearing ANGLE: "))
(cond ((or (= quad nil) (= quad 1)) (setq ang (- (* 0.5 pi) ang )))
((= quad 2) (setq ang (+ (* 0.5 pi) ang )))
((= quad 3) (setq ang (- (* 1.5 pi) ang )))
((= quad 4) (setq ang (+ (* 1.5 pi) ang )))
)
(command "line" p1 (polar p1 ang dist) "")
(command "circle" p1 crad)
)
(defun C:CRAD ()
(setq crad (getdist "\nRadius for junction CIRCLE: "))
)
(defun C:DAGO ()
(if (= crad nil) (setq crad (getdist "\nRadius for junction CIRCLE: ")))
(setq p1 (osnap
(getpoint "\nSelect line END to start ARC FROM (do not osnap): ") "endp"))
(command "line" p1)
(setq p2 (getpoint "\nSide to offset towards: "))
(command ())
(setq a1 (+ pi (angle p2 (osnap p1 "perp"))))
(setq ang (getangle "\nArc's included ANGLE: "))
(setq ans (getint "\nDirection? CCW=1 CW=2 <1>: "))
(if (= ans 2) (setq ang (* -1.0 ang)))
(setq rad (getdist "\nArc's RADIUS: "))
(setq p2 (polar p1 a1 rad))
(command "pline" p1 "A" "CE" p2 "A" (angtos ang 0 4) "")
(command "circle" p1 crad)
)